****************************************************************
****************************************************************
*REPLICATION FILE **********************************************
*"Buying Evidence: Policy Research as a Presidential Commodity"*
*Journal of Politics *******************************************
*Rachel Augustine Potter ***************************************
*rapotter@virginia.edu *****************************************
*December 2023 **************************************************
****************************************************************
****************************************************************

*This .do file creates Figure 1 in the paper 

use "research_contracts.dta"

gen study_genre = ""
replace study_genre = "Air quality" if product_or_service_code == "B502"
replace study_genre = "Archaelogical" if product_or_service_code == "B503"
replace study_genre = "Chemical-biological" if product_or_service_code == "B504"
replace study_genre = "Cost benefit analyses" if product_or_service_code == "B505"
replace study_genre = "Data" if product_or_service_code == "B506"
replace study_genre = "Economic" if product_or_service_code == "B507"
replace study_genre = "Plants" if product_or_service_code == "B509"
replace study_genre = "Enviro assessment" if product_or_service_code == "B510"
replace study_genre = "Feasibility" if product_or_service_code == "B513"
replace study_genre = "Animal/ Fisheries" if product_or_service_code == "B516"
replace study_genre = "Geological" if product_or_service_code == "B517"
replace study_genre = "Geophysical" if product_or_service_code == "B518"
replace study_genre = "Geotechnical" if product_or_service_code == "B519"
replace study_genre = "Grazing/ range" if product_or_service_code == "B520"
replace study_genre = "Historical" if product_or_service_code == "B521"
replace study_genre = "Legal" if product_or_service_code == "B522"
replace study_genre = "Math/ statistics" if product_or_service_code == "B524"
replace study_genre = "Natural resources" if product_or_service_code == "B525"
replace study_genre = "Oceanological" if product_or_service_code == "B526"
replace study_genre = "Recreation" if product_or_service_code == "B527"
replace study_genre = "Regulatory" if product_or_service_code == "B528"
replace study_genre = "Scientific data" if product_or_service_code == "B529"
replace study_genre = "Seismological" if product_or_service_code == "B530"
replace study_genre = "Soil" if product_or_service_code == "B532"
replace study_genre = "Water quality" if product_or_service_code == "B533"
replace study_genre = "Wildlife" if product_or_service_code == "B534"
replace study_genre = "Medical/ health" if product_or_service_code == "B537"
replace study_genre = "Intelligence" if product_or_service_code == "B538"
replace study_genre = "Aeronautic/Space" if product_or_service_code == "B539"
replace study_genre = "Bldg technology" if product_or_service_code == "B540"
replace study_genre = "Defense" if product_or_service_code == "B541"
replace study_genre = "Educational" if product_or_service_code == "B542"
replace study_genre = "Energy" if product_or_service_code == "B543"
replace study_genre = "Technology" if product_or_service_code == "B544"
replace study_genre = "Housing/ community" if product_or_service_code == "B545"
replace study_genre = "Security" if product_or_service_code == "B546"
replace study_genre = "Accounting" if product_or_service_code == "B547"
replace study_genre = "Trade" if product_or_service_code == "B548"
replace study_genre = "National security" if product_or_service_code == "B549"
replace study_genre = "Manpower" if product_or_service_code == "B550"
replace study_genre = "Preparedness" if product_or_service_code == "B551"
replace study_genre = "Manpower" if product_or_service_code == "B552"
replace study_genre = "Communications" if product_or_service_code == "B553"
replace study_genre = "Acquisition" if product_or_service_code == "B554"
replace study_genre = "Elderly/ disabled" if product_or_service_code == "B555"
replace study_genre = "Other studies" if product_or_service_code == "B599"


*Create figure 1
*Note: As noted in the paper, I exclude studies categorized as "other" from this figure since the label is not informative as to the substance of the work. This is, however, the largest category of spending
graph bar (sum) pos_obligation if study_genre != "Other studies", over(study_genre, label(angle(90) labsize(*0.7))) ylab(,angle(360)) ytitle("Total $ (in millions)") graphregion(color(white)) scheme(s2mono) name(study_type, replace) ylab(2000000000 "2,000" 4000000000 "4,000" 6000000000 "6,000" 8000000000 "8,000") 

